package com.ithei.多线程第二天.阻塞队列等待唤醒机制实现;

import java.util.concurrent.ArrayBlockingQueue;

public class Foodie extends  Thread{
    ArrayBlockingQueue<String> ab;

    public Foodie(ArrayBlockingQueue<String> ab) {
        this.ab = ab;
    }

    @Override
    public void run() {
        while (true){
            try {
                System.out.println("吃货从队列中获取了:  "+ab.take());
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
